<?php
/**
 * 药物
 */
class Drugs{
  /**
   * @var string Identity药物编号
   */
  public $Id;
      
  /**
   * @var string 药物名称
   */
  public $Name;
      
  /**
   * @var float 价格
   */
  public $Price;
      
  /**
   * @var float 药物等效比例
   */
  public $Race;
      
  /**
   * @var int 药物排序
   */
  public $Order;
      
  /**
   * @var int 状态
   */
  public $Status;
      
  /**
   * @var datetime 建立日期
   */
  public $CreateDate;
      
  /**
   * @var datetime 修改日期
   */
  public $ModifyDate;
      
  public function __construct(){
		$var=get_class_vars(__CLASS__);
    foreach(func_get_args() as $o){
      if(is_array($o)){
        foreach($o as $k => $v){
            if($k=='Id'){
              $this->Id=$v;
              }
            else if($k=='Name'){
                $this->Name=$v;
            }
            else if($k=='Price'){
                $this->Price=floatval($v);
            }
            else if($k=='Race'){
                $this->Race=floatval($v);
            }
            else if($k=='Order'){
                $this->Order=intval($v);
            }
            else if($k=='Status'){
                $this->Status=intval($v);
            }
            else if($k=='CreateDate'){
                $this->CreateDate=intval($v);
            }
            else if($k=='ModifyDate'){
                $this->ModifyDate=intval($v);
            }
        }
      }else if(is_object($o)){
        foreach($var as $k => $v){
          if(isset($o->Id)){
            $this->Id=$o->Id;
          }
          if(isset($o->Name)){
            $this->Name=$o->Name;
          }
          if(isset($o->Price)){
            $this->Price=$o->Price;
          }
          if(isset($o->Race)){
            $this->Race=$o->Race;
          }
          if(isset($o->Order)){
            $this->Order=$o->Order;
          }
          if(isset($o->Status)){
            $this->Status=$o->Status;
          }
          if(isset($o->CreateDate)){
            $this->CreateDate=$o->CreateDate;
          }
          if(isset($o->ModifyDate)){
            $this->ModifyDate=$o->ModifyDate;
          }
        }
      }
    }
  }

  public function __modetoarray(){
    $var=array();
    foreach(get_class_vars(__CLASS__) as $k => $v){
      $var[$k]=$this->$k;
    }
    return $var;
  }
}
?>